<template>
  <div class="goTop"></div>
</template>
<script>
export default {
  props: {
    home: String
  },
  data() {
    return {}
  },
  mounted() {
    let home = this.home;
    $('.goTop').click(function () {
      $("." + home).animate({scrollTop: 0}, 600);
    });
  },
  methods: {}
}
</script>
<style>
.goTop {
  display: block;
  position: fixed;
  bottom: 75px;
  width: 150px;
  height: 150px;
  right: -999px;
  background: url("https://www.hualigs.cn/image/60a3e240270f1.jpg") no-repeat center;
  background-size: cover;
  cursor: pointer;
  transition: right 0.7s;
}

.goTop:hover {
  background: url("https://www.hualigs.cn/image/60a4782d39681.jpg") no-repeat center;
  background-size: cover;
  cursor: pointer;
  transition-duration: 0.7s;
}

.goTop img {
  width: 150px;
  cursor: pointer;
}
</style>
